package cn.zn.controller.system;

import cn.zn.base.bean.dto.ResultData;
import cn.zn.base.common.utils.ResultUtil;
import cn.zn.external.service.SysExternalService;
import cn.zn.framework.utils.SecurityUtil;
import cn.zn.user.entity.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/system/exosystem")
public class SysExternalController {

    @Autowired
    private SysExternalService sysExternalService;

    @GetMapping(value = "/{type}")
    public ResultData getExosystem(@PathVariable String type) {
        SysUser user = SecurityUtil.getTheUser();
        return ResultUtil.success(sysExternalService.findExosystemByType(type, user));
    }

}
